package com.example.hyw.szysteam.view;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;

import com.example.hyw.szysteam.POJO.UserInfo;
import com.example.hyw.szysteam.R;
import com.qmuiteam.qmui.widget.QMUITopBar;
import com.qmuiteam.qmui.widget.dialog.QMUIBottomSheet;
import android.util.Log;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.Toast;


/**
 * Created by HYW on 2018/5/22.
 */

public class CommunityFragment extends Fragment implements View.OnClickListener{
    LinearLayout buttonClass;
    LinearLayout buttonFrends;
    QMUITopBar mTopBar;
    View view;
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view=inflater.inflate(R.layout.fragment_community,container,false);
        initTopBar();
        initView();
        return view;
    }
    private void initTopBar(){
        mTopBar=view.findViewById(R.id.community_topbar);
        mTopBar.setTitle("消息").setTextColor(getResources().getColor(R.color.myWhite));
    }

    private void initView(){
        buttonClass=view.findViewById(R.id.button_class);
        buttonFrends=view.findViewById(R.id.button_frends);
        buttonClass.setOnClickListener(this);
        buttonFrends.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        Intent intent;
        switch (view.getId()) {
            case R.id.button_class:
                intent=new Intent(getActivity(),ClassActivity.class);
                startActivity(intent);
                break;
            case R.id.button_frends:
            default:
                intent=new Intent(getActivity(),FrendsActivity.class);
                startActivity(intent);
        }
    }

}
